package org.budo.validation.validator.impl;

import java.lang.annotation.Annotation;

import javax.validation.constraints.NotNull;

import org.budo.validation.exception.BudoNotNullValidationException;
import org.budo.validation.validator.BudoValidator;

/**
 * @author lmw
 */
public class NotNullValidator implements BudoValidator {
    public void validate(Annotation annotation, Integer parameterIndex, String parameterName, Object argumentValue) {
        if (null == argumentValue) {
            throw new BudoNotNullValidationException(parameterIndex, parameterName, (NotNull) annotation, argumentValue);
        }
    }
}